// Copyright 2022 a.o.smith ALL Rights Reserved
package com.liuxinlong.enums;

/**
 * 消息推送来源类型枚举
 *
 * @author liuxinlong@hotwater.com.cn
 * @version 1.0.0
 * @since 2023-02-02
 */
public enum NotificationSourceEnum {
    CHIMI_COMMENT(1, "评论"),
    CHIMI_REPLY(2, "回复"),
    CHIMI_CARD(3, "发帖"),
    STANDARD(4, "标准模块"),
    BUTLER(5, "知识充电站"),
    SYSTEM(6, "系统通知"),
    EXPERT_MODULE(7, "专家模块"),
    CONVOLUTION_MODULE(8, "成本卷积"),
    PATENT_MODULE(9, "专利模块"),
    PATENT_TRENDS(10, "专利动态");

    private int value;

    private String name;

    NotificationSourceEnum(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public int getValue() {
        return value;
    }

    public String getName() {
        return name;
    }

    public static String getNameByValue(int value) {
        NotificationSourceEnum arrObj[] = NotificationSourceEnum.values();
        for (NotificationSourceEnum obj : arrObj) {
            if (value == obj.getValue()) {
                return obj.getName();
            }
        }
        return " ";
    }

    public static String getSourceNameByValue(int value) {
        NotificationSourceEnum arrObj[] = NotificationSourceEnum.values();
        for (NotificationSourceEnum obj : arrObj) {
            if (value < 4) {
                return "CHIMI模块";
            } else if (value == obj.getValue()) {
                return obj.getName();
            }
        }
        return " ";
    }
}
